package net.mobgame.android.widget;

import net.mobgame.android.R;
import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class MobgameDialog extends Dialog {

	private TextView txt_message,textTitle;
	private Button btn_yes, btn_no;
	
	public MobgameDialog(Context context){
		super(context, R.style.mobgamedialog_theme);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.custom_dialog);
		txt_message = (TextView) findViewById(R.id.txt_message);
//		textTitle = (TextView)findViewById(R.id.textTitle);
		btn_yes = (Button) findViewById(R.id.dialogButtonOK);
		btn_no = (Button) findViewById(R.id.dialogButtonCancle);
		btn_yes.setText(btn_yes.getText().toString().toUpperCase());
		btn_no.setText(btn_no.getText().toString().toUpperCase());
	}
	
	public void setTextTitle(String title){
		if (textTitle != null) textTitle.setText(title); 
	}
	
	public void setTextMessage(String message){
		if (txt_message != null) txt_message.setText(message);
	}
	
	public void setButtonYes(android.view.View.OnClickListener listener) {
		if (btn_yes != null) btn_yes.setOnClickListener(listener);
	}

	public void setButtonNo(android.view.View.OnClickListener listener) {
		if (btn_no != null) btn_no.setOnClickListener(listener);
	}
}
